﻿@model BuyThePeople.Models.UserForJointPurchaseData

@{
    ViewBag.Title = "UserJointPurchase";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@using (Html.BeginForm()){
    <div class="main_container">
		<div id="content">		
			<div id="buttonList" style="margin:10px;">
				<a class="btn" href="@Url.Content(BuyThePeople.ConstFactory.UrlUserInfo)">회원정보수정</a>				
				<a id="button1" class="btn" href="#" onclick="AddJointList(1)">공구참여내역보기</a>				
				<a id="button2" class="btn" href="#" onclick="AddJointList(2)">공구종료보기</a>
                @if ((Session[BuyThePeople.ConstFactory.SessionUser] as BuyThePeople.Models.UserLoginData).IsSeller == true){
				<a id="button3" class="btn" href="#" onclick="AddJointList(3)">입찰내역보기</a>
                }
			</div>
			<!-- 해더 -->
			<div style="margin:10px 10px 0px 10px; width:902px;height:35px;">
				<div style="background-color:#494949; width:100%; height:35px;border-top-right-radius:10px;border-top-left-radius:10px;">				
					<div style="float:left;width:140px;text-align:center;border-right: 1px solid #626262;">
						<span style="line-height:35px;color:white;font-size:9pt;" id="spanDate">결제일</span>
					</div>
					<div style="float:left;width:550px;text-align:center;border-right: 1px solid #626262;">
						<span style="line-height:35px;color:white;font-size:9pt;">상품정보</span>
					</div>
					<div style="float:left;width:200px;text-align:center;">
						<span style="line-height:35px;color:white;font-size:9pt;">비고</span>
					</div>
					<div style="clear:both;">
					</div>
				</div>
			</div>
			<div id="gonggucontent" class="gonggucontent">
			</div>
			
			<!--푸터푸터-->
			<div style="clear:both;">
				<div style="margin:0px 10px 10px 10px; width:902px;background-color:#f9f9f9;  height:5px;border-bottom-right-radius:5px;border-bottom-left-radius:10px;">
			</div>
			<div style="margin:10px;">
			</div>

		</div>
	</div>		
    </div>
}

	<script type="text/javascript">
	    function AddJointList(type) {
	        var urlAdd;
	        switch (type) {
	            case 1:
	                urlAdd = '@Url.Action("AddJointList")/@(BuyThePeople.Composition.JointPurchaseType.Participation)';
	                $("#spanDate").text("참여일");
	                break;
                case 2:
                    urlAdd = '@Url.Action("AddJointList")/@(BuyThePeople.Composition.JointPurchaseType.Termination)';
                    $("#spanDate").text("결제일");
                    break;
                case 3:
                    urlAdd = '@Url.Action("AddJointList")/@(BuyThePeople.Composition.JointPurchaseType.Bid)';
                    $("#spanDate").text("입찰일");
	                break;
	        }
	        $('#buttonList > a').removeClass("btn-inverse");
	        $('#button' + type.toString()).addClass("btn-inverse");
	        $.get(urlAdd, function (data) {
	            $('#gonggucontent').empty();
	            $('#gonggucontent').append(data);
	            //$('#gonggucontent > div').remove();
	            //$('#gonggucontent > div').after(data);
	        });
	    }
	    @ViewBag.ScriptBlock
	</script>